package com.ruoyi.product.es;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.ruoyi.common.core.annotation.Excel;
import lombok.Data;
import nonapi.io.github.classgraph.json.Id;
import org.apache.poi.ss.formula.functions.T;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;
import org.springframework.data.elasticsearch.annotations.Setting;

import java.util.Date;

/**
 * @Author: badaotianqiong
 * @Date: 2025/8/10 15:16
 * @Description:
 **/
@Data
@Document(indexName = "es_product")
@Setting(shards = 1,replicas = 0)
public class ProdEs {

    private static final long serialVersionUID = 1L;

    @Id
    @Field(type = FieldType.Keyword)
    private Integer prodId;

    @Field(type = FieldType.Text)
    private String prodSpu;

    @Field(type = FieldType.Integer)
    private Integer prodKind;

    @Field(type = FieldType.Integer)
    private Integer prodType;

    @Field(type = FieldType.Text,analyzer = "ik_max_word")
    private String prodName;

    @Field(type = FieldType.Integer)
    private Integer brandId;

    @Field(type = FieldType.Integer)
    private Integer prodStatus;

    @Field(type = FieldType.Integer)
    private Integer unitId;

    @Field(type = FieldType.Integer)
    private Integer tagId;

    @Field(type = FieldType.Text)
    private String appr;

    @Field(type = FieldType.Keyword,index = false)
    private String prodImage;

    @Field(type = FieldType.Text)
    private String createBy;

    @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @Field(type = FieldType.Date,pattern = "yyyy-MM-dd HH:mm:ss",format = {})
    private Date createTime;

    @Field(type = FieldType.Text)
    private String updateBy;

    @JsonFormat(shape = JsonFormat.Shape.STRING,pattern = "yyyy-MM-dd HH:mm:ss",timezone = "GMT+8")
    @Field(type = FieldType.Date,pattern = "yyyy-MM-dd HH:mm:ss",format = {})
    private Date updateTime;


}
